$OpenBSD: patch-common_py,v 1.1.1.1 2015/10/13 16:58:07 jca Exp $

Backport upstream fix for missing ~/.wxglade/ directory.

  https://bitbucket.org/agriggio/wxglade/commits/4c3c49e4cf61a1d8127a74a396016ffa4fbaa97b?at=default

--- common.py.orig	Fri Oct  9 16:03:04 2015
+++ common.py	Fri Oct  9 16:06:20 2015
@@ -8,6 +8,7 @@ Global variables
 
 import ConfigParser
 import logging
+import os
 import os.path
 import sys
 import zipfile
@@ -1229,6 +1230,11 @@ def init_paths():
     config.log_file = os.path.join(
         config.appdata_path, 'wxglade.log'
         )
+
+    # create missing application data directory, otherwise log initialisation
+    # will failed with an IOError "No such file or directory"
+    if not os.path.isdir(config.appdata_path):
+        os.makedirs(config.appdata_path, 0700)
 
 
 def init_preferences():
